from django.shortcuts import render
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import viewsets
from rest_framework.filters import SearchFilter, OrderingFilter
from .serializers import *
from .filters import *
from .models import Label, LabelStickGood
from apps.pagination import *


# Create your views here.
class GoodLabelListViewSet(viewsets.ModelViewSet):
    """
        GoodLabelListViewSet

    """
    queryset = Label.objects.all()  # queryset
    serializer_class = LabelSerializer
    pagination_class = StandardResultsSetPagination
    filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
    filter_class = GoodLabelFilter
    search_fields = []


class GoodLabelStickGoodListViewSet(viewsets.ModelViewSet):
    """
    GoodLabelStickGoodListViewSet
    """
    queryset = LabelStickGood.objects.all()  # queryset
    serializer_class = LabelStickGoodSerializer
    pagination_class = StandardResultsSetPagination
    filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
    filter_class = GoodLabelStickGoodFilter
    search_fields = []

